<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!--#include file="../include/conn.asp" -->
<!--#include file="seeion.asp"-->
<!--#include file="contentfun.asp" -->
<!--#include file="page.asp" -->
<%
psize=request.querystring("psize")
SortID=request.querystring("SortID")
sorttype= CSchannelID(sortid)
%>
<!doctype html public "-//w3c//dtd html 4.01 transitional//en" "http://www.w3c.org/tr/1999/rec-html401-19991224/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title><%=sorttypename%>列表</title>
<meta http-equiv=Content-Type content="text/html; charset=utf-8">
<link href="images/style.css" type=text/css rel=stylesheet>
</head>
<SCRIPT>
//复选
function selectAll(chk)
{  
var chk = document.form1.chkAll.checked;
for (i=0;i<document.all.length;i++) {
if (document.all[i].name=="id") {
document.all[i].checked=chk;
chkRow(document.all[i]);
}}}

//复选后单元格变色
function chkRow(obj){
var r = obj.parentElement.parentElement;
if(obj.checked){ r.style.backgroundColor="#FF6";}
else 
{
r.style.backgroundColor="";}
}
</SCRIPT>
<body>
<form name="form1" action="?" method="post">
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
  <tr>
    <td height="30" class="topnav">
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
   <td width="100px" height=30 style="padding-left:20px;"><%=sorttypename%>列表</td>
   <td width="80px" height=30><input onClick="location.href='add_content.asp?<%="sorttype="&sorttype&"&sortid="&sortid&"&keyword="&keyword&"&page="&page&"&psize="&psize&"&order="&order&"&ordsc="&ordsc&""%>'" type="button" value="<%=sorttypename%>添加" class="btn" >  </td>
   <td style="padding-left:20px;"><%=sorttypename%>分类：<%loadselect "sortid","zych_type","sortname","sortid",sortid, 0,"and TopSortID="&SortID&" order by px_id","所有分类",0,"class=sel"%>
      关键词：<input class="inp" size="16" name="keyword" value="<%=keyword%>">
      <input class="btn" type="submit" value="搜 索" name="submit" onClick="form.action='?<%="sortid="&sortid&"&keyword="&keyword&"&page=&psize="&psize&"&order="&order&"&ordsc="&ordsc&""%>';">
      <input onClick="location.href='<%=getpagename()%>?<%="sorttype="&sorttype%>'" type="button" value="全 部" class="btn" /></td>
   <td width="150px" colspan=2 align=right style="padding-right:20px;">
    <input onClick="location.href='Pro_field.asp?Field=admin&Fieldfl=<%=sortid%>'" type="button" value="<%=sorttypename%>字段管理" class="btn" > 
   
</td>
  </tr>
</table>

    </td>
  </tr>
  <tr>
    <td bgcolor="#ffffff">
    
<table width="100%" border=0 align=center cellpadding=3 cellspacing=0 class="stable">
  <tbody>
  <thead>
  <tr style="background-color:#eeeeee">
    <td width=50 align="center" class=td>选 择</td>
    <td width=60 align="center" class=td>编 号</td>
    <td width=50 align="center" class=td>模 型</td>
    <td width=100 align="center" class=td>所在分类</td>
    <td width=100 align="center" class=td>缩略图</td>
    <td align="center" class=td>标 题</td>
    <td width=80 align="center" class=td>浏览权限</td>
    <td width=150 align="center" class=td>发布时间</td>
    <td width=100 align="center" class=td>排 序</td>
    <td width=100 align="center" class=td>状 态</td>
    <td width=140 align="center" class=td>操 作</td>
    </tr>
    </thead>
<%
if psize="" then
numperpage="20"
else
numperpage=""&psize&""
end if
if isnul(order) then order="Cid"
if isnul(ordsc) then ordsc="desc"
if not isnul(keyword) then wherestr = wherestr&" and title like '%"&keyword&"%'"
orderstr=" order by px_id desc,"&order&" "&ordsc &""
set rs=server.createobject("adodb.recordset") 
exec="select * from content where topSortID="&SortID&" "&wherestr&" "&orderstr&""
rs.open exec,conn,1,1 
if rs.eof then
response.write "<tr align=""center""><td colspan='8' class=td height=""28"">暂无内容记录...</td></tr>"
else
rs.pagesize =numperpage'每页记录条数
icount=rs.recordcount '记录总数
ipagesize=rs.pagesize
maxpage=rs.pagecount 
page=request("page")
if not isnumeric(page) or page="" then
page=1
else
page=cint(page)
end if
if page<1 then
page=1
elseif  page>maxpage then
page=maxpage
end if
rs.absolutepage=page
if page=maxpage then
x=icount-(maxpage-1)*ipagesize
else
x=ipagesize
end if	
for i=1 to rs.pagesize
if IsNull(rs("img")) or rs("img")="" then
img="<img src=""images/nopic.gif"" width=""50"" height=""25"" alt=""图片缩略图""/>"
else
img="<img src="&rs("img")&" width=""50"" height=""25"" alt=""图片缩略图""/>"
end if
add=Year(rs("AddTime"))&Month(rs("AddTime"))&day(rs("AddTime"))
xdat=Year(DATE())&Month(DATE())&day(DATE())
if add=xdat then jrxz="<font color=#FF6600>今日新增</font>" else jrxz=""
%>
<tr bgcolor="#ffffff" align="center">
<td align="center" class=td><input type="checkbox" name="id" value="<%=rs("Cid")%>" class="checkbox" onClick="javascript:chkRow(this);"/></td>
<td align="center" class=td><input type="text" readonly style="text-align:center; width:40px" value="<%=rs("cid")%>" class="inp"/></td>
<td class=td align="center"><%=channelname(rs("sorttype"))%></td>
<td align="center" class=td><%=zychclass_name(rs("sortid"),sorttype)%></td>
<td align="center" class=td><%=img%></td>
<td align="left" class=td><a href="/Show/?Cid=<%=rs("Cid")%>" target="_blank" title="浏览">【前台浏览】</a> <a style="color:<%=rs("titlecolor")%>" href="edit_content.asp?Cid=<%=rs("Cid")%>&sorttype=<%=sorttype%>&sortid=<%=sortid%>&keyword=<%= keyword %>&page=<%= page %>&psize=<%= psize %>&order=<%= order %>&ordsc=<%=ordsc%>" title="点击修改"><%= rs("title")%></a> <%=getstr(rs("istop"),"[<font color=""red"">置顶</font>]","")&getstr(rs("tuijian"),"[<font color=""red"">推荐</font>]","")&getstr(rs("tuwen"),"[<font color=""red"">图文</font>]","")&getstr(rs("isoutlink"),"[<font color=""red"">链接</font>]","")%> <%=jrxz%>
</td>
<td align="center" class=td><%=showkey(rs("Star"))%></td>
<td align="center" class=td <%if rs("addtime")>now() then %>style="color:#F00" <%end if%>><%=rs("addtime")%></td>
<td align="center" class=td><input type="hidden" name="nid" value="<%= rs("Cid") %>" style="width:40px;"><input type="text" name="order" value="<%= rs("px_id") %>" style="width:40px; text-align:center;" class="inp"/></td>
<td align="center" class=td><%=getstr(rs("isok"),"<a href=""?action=off&id="&rs("Cid")&"&sorttype="&sorttype&"&sortid="&sortid&"&keyword="&keyword&"&page="&page&"&psize="&psize&"&order="&order&"&ordsc="&ordsc&""" title=""启用"" ><img src=""images/toolbar_ok.gif""></a>","<a href=""?action=on&id="&rs("Cid")&"&sorttype="&sorttype&"&sortid="&sortid&"&keyword="&keyword&"&page="&page&"&psize="&psize&"&order="&order&"&ordsc="&ordsc&""" title=""禁用"" ><img src=""images/toolbar_no.gif""></a>")%></td>
<td align="center" class=td><input type="button" name="submit3" value="修 改" onClick="window.location.href='edit_content.asp?Cid=<%=rs("Cid")%>&sorttype=<%=sorttype%>&sortid=<%=sortid%>&keyword=<%= keyword %>&page=<%= page %>&psize=<%= psize %>&order=<%= order %>&ordsc=<%= ordsc %>' "  class="btn"/> | <input type="button" name="submit" value="删 除" onClick="javascript:if(confirm('确定删除？删除后不可恢复!')){window.location.href='?action=del&id=<%=rs("Cid")%>&sorttype=<%=sorttype%>&sortid=<%=sortid%>&keyword=<%=keyword%>&page=<%=page%>&psize=<%=psize%>&order=<%=order%>&ordsc=<%=ordsc%>';}else{history.go(0);}"  class="btn"/></td>
</tr>
<%rs.movenext
if rs.eof then exit for 
next%>
  <tr>
    <td align="center"><input type="checkbox" name="chkAll" title="全选/取消" onClick="selectAll()"></td>
    <td align="center"> 全选</td>
    <td height="28" colspan="9" align="left" class=td style="padding-left:10px">
  <input class="btn" type="submit" value="删 除" onClick="if(confirm('确定要删除吗')){form.action='?action=del<%="&sorttype="&sorttype&"&sortid="&sortid&"&keyword="&keyword&"&page="&page&"&psize="&psize&"&order="&order&"&ordsc="&ordsc&""%>';}else{return false};"/>  
  <input class="btn" type="submit" value="禁 用" onClick="form.action='?action=off<%="&sorttype="&sorttype&"&sortid="&sortid&"&keyword="&keyword&"&page="&page&"&psize="&psize&"&order="&order&"&ordsc="&ordsc&""%>';"./>
  <input class="btn" type="submit" value="启 用" onClick="form.action='?action=on<%="&sorttype="&sorttype&"&sortid="&sortid&"&keyword="&keyword&"&page="&page&"&psize="&psize&"&order="&order&"&ordsc="&ordsc&""%>';"/>
  <input class="btn" type="submit" value="更新排序" onClick="form.action='?action=order<%="&sorttype="&sorttype&"&sortid="&sortid&"&keyword="&keyword&"&page="&page&"&psize="&psize&"&order="&order&"&ordsc="&ordsc&""%>';"/>
      移动到:<%loadselect "movesortid","zych_type","sortname","sortid",getform("id","get"), 0,"and topsortid="&sortid&" order by px_id","请选择分类",0,""%>
  <input class="btn" type="submit" value="移 动" onClick="form.action='?action=move<%="&sorttype="&sorttype&"&sortid="&sortid&"&keyword="&keyword&"&page="&page&"&psize="&psize&"&order="&order&"&ordsc="&ordsc&""%>';"/>
<%call PageControl(iCount,maxpage,page)
rs.close
set rs=nothing
end if%></td>
    </tr>
    </table>
    </td>
  </tr>
  
</table>
</form>
<%call footer%>
</body></html>
